package com.base.core.head.vo;

import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 
 * @author start
 *
 */
@Getter@Setter@ToString
public class WsMessageVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public WsMessageVO(String requestId,String bizType,String msgType,Long targetId) {
		this(null,requestId,bizType,msgType,targetId);
	}
	
	public WsMessageVO(String clientId,String requestId,String bizType,String msgType,Long targetId) {
		this(200,clientId,requestId,bizType,msgType,targetId);
	}
	
	public WsMessageVO(int code,String clientId,String requestId,String bizType,String msgType,Long targetId) {
		this.code=code;
		this.clientId=clientId;
		this.requestId=requestId;
		this.bizType=bizType;
		this.msgType=msgType;
		this.targetId=targetId;
		this.timestamp=System.currentTimeMillis();
	}

	@Schema(description="客户端Id(服务端单独生成的消息无该值)")
	private String clientId;

	@Schema(description="请求Id",requiredMode = RequiredMode.REQUIRED)
	private String requestId;
	
	@Schema(description="业务类型",requiredMode = RequiredMode.REQUIRED)
	private String bizType;
	
	@Schema(description="消息类型",requiredMode = RequiredMode.REQUIRED)
	private String msgType;

	@Schema(description="目标Id(用户Id、群组Id、剧情卡Id)根据业务(bizType)决定")
	private Long targetId;

	@Schema(description="时间戳(服务端下行时间)",requiredMode = RequiredMode.REQUIRED)
	private Long timestamp;
	
	@Schema(description = "状态码，程序执行中的一种状态'200:表示执行完毕,204:未获取到数据等[详情](/static/doc/response_code.html)",example = "200",requiredMode = RequiredMode.REQUIRED)
	private int code;

	@Schema(description = "状态消息（仅供开发对接,展示请根据Code单独处理）",example = "OK")
	private String message;

}
